using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
	[System.Serializable, NodeMenuItem(LevelEditorConst.Execution + "/" + LevelEditorConst.StartMiniGame, typeof(LevelServiceGraph))]
    public partial class LevelServiceExecutionNode_StartMiniGame : LevelServiceExecutionNode
    {
		protected override ServiceExecutionType mServiceType => ServiceExecutionType.StartMiniGame;
        public override string name => LevelEditorConst.StartMiniGame;
		
# region property
        [LevelServiceEditorCustomProperty(ServiceExecutionType.StartMiniGame, "类型")]
        public int type;
        [LevelServiceEditorCustomProperty(ServiceExecutionType.StartMiniGame, "小游戏配置id")]
        public int cid;
# endregion property
		protected override LevelServiceCustomConfig CreateConfig()
        {
        	LevelServiceExecutionCustom_StartMiniGame rConfig;
# region CreateConfig
            rConfig = new LevelServiceExecutionCustom_StartMiniGame
            {
                type = this.type,
                cid = this.cid,
            };
# endregion CreateConfig
            return rConfig;
        }

        protected override void OnSync(EditorLevelServiceExecutionConfig newConfig, LevelServiceExecutionNode tempNode)
        {
# region OnSync
            if (tempNode is LevelServiceExecutionNode_StartMiniGame rNode)
            {
                this.type = rNode.type;
                this.cid = rNode.cid;
            }
# endregion OnSync
        }
    }
}